import request from '@/utils/request'

//查询单据
export function listBill(data){
	return request({
		method:"get",
		url:"/om/deliver/list",
		params:data
	})
}

//字典
export function dictMatching (data) {
  return request({
    url: '/system/dict/data/type/'+ data,
    method: 'get',
  })
}

// 查询部门列表
export function listDept(query) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: query
  })
}

  // 查询物料基本信息
export function listMaterial(query) {
  return request({
    url: 'inv/items/list',
    method: 'get',
    params: query
  })
}

// 查询人员列表
export function listUser(query) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: query
  })
}

// 查询发货单明细
export function listDeliverDetail(data) {
  return request({
   method:"get",
   url:"/om/deliver/getDetail",
   params:data
  })
}


// 查询订单明细
export function listOrderDetail(data) {
  return request({
   method:"get",
   url:"/om/order/getDetail",
   params:data
  })
}

// 查询计量单位
export function listPacking(query) {
  return request({
    url: 'inv/unit/list',
    method: 'get',
    params: query
  })
}

// 上一条下一条
export function NextBill(query) {
  return request({
    url: '/om/deliver/nextOrLast/',
     method: 'get',
    params: query
  })
}


//新增单据
export function addBill(data){
	return request({
		method:"post",
		url:"/om/deliver",
		data:data
	})
}


// 查看单据
export function seeBill(query) {
  return request({
    url: '/om/deliver/',
    method: 'get',
      params: query
  })
}

// 更新单据
export function updateBill(data){
	return request({
		method:"put",
		url:"/om/deliver",
		data:data
	})
}

// 删除单据
export function deleteBill(data) {
  return request({
      url: '/om/deliver/delete',
     method: 'post',
     data:data
  })
}

//审核单据
export function examineBill(data){
	return request({
		method:"post",
		url:"/om/deliver/check",
		data:data
	})
}

//反审核单据
export function examineDeBill(data){
	return request({
		method:"post",
		url:"/om/deliver/antiCheck",
		data:data
	})
}
// 获取单据参数
export function billParameters(query) {
  return request({
    url: '/system/config/form',
    method: 'get',
    params: query
  })
}


// 查询客户
export function listCustomer(query) {
  return request({
    url: '/om/customer/list',
    method: 'get',
    params: query
  })
}

// 新增客户
export function addCustomer(data) {
  return request({
    url: '/om/customer',
    method: 'post',
    data: data
  })
}

//关联物料
export function listLink(query) {
  return request({
    url: '/om/deliver/chain',
   method: 'get',
   params: query
  })
}

// 获取仓库列表
export function listWarehouses(query) {
  return request({
    url: '/wm/warehouses/listAll',
    method: 'get',
    params: query
  })
}

// 导出明细
export function exportDetail(query) {
  return request({
    url: '/om/deliver/export',
    method: 'get',
    params: query
  })
}

//模块参数
export function moduleParameters (query) {
  return request({
    url: '/system/config/list',
    method: 'get',
    params: query
  })
}

// 操作单据
export function operationBill(data) {
  return request({
    url: '/om/deliver/operate',
    method: 'post',
    data: data
  })
}
